package org.codeart.strategy.example03;

import org.codeart.strategy.pojo.Receipt;

/**
 * 策略上下文
 */
public class ReceiptContext {
    
    private ReceiptHandleStrategy strategy;

    public ReceiptContext() {
    }

    public void setStrategy(ReceiptHandleStrategy strategy) {
        this.strategy = strategy;
    }

    public void handleReceipt(Receipt receipt) {
        if (receipt != null) {
            strategy.handleReceipt(receipt);
        }
    }
}
